package com.mmall.concurrency.tujie.chapter5;

import lombok.extern.slf4j.Slf4j;

import java.util.concurrent.ArrayBlockingQueue;

/**
 * @author 孙许
 * @date 2018-05-21
 * @description
 */
@Slf4j
public class Table2 extends ArrayBlockingQueue<String> {

    public Table2(int count) {
        super(count);
    }

    @Override
    public void put(String cake) throws InterruptedException {
        log.info(Thread.currentThread().getName() + " puts " + cake);
        super.put(cake);
    }

    @Override
    public String take() throws InterruptedException {
        String cake = super.take();
        log.info(Thread.currentThread().getName() + " takes " + cake);
        return cake;
    }
}
